@echo off
@echo Available environments:
@echo   - development (default)
@echo   - development_demo
@echo   - development_localhost
@echo   - development_localhost_root
@echo   - development_root
@echo   - development_test

if "%1%" == "" goto run
set migenv=-Dmigration.env=%1

:run
@echo mvn migration:status %migenv%
mvn migration:status %migenv%
exit

tote\database\migration\environments:
development.properties
development_demo.properties
development_localhost.properties
development_localhost_root.properties
development_root.properties
development_test.properties


1. Run in pom.xml file directory
2. Get migration status (with defined property file - see ../environments) 
   mvn migration:status -Dmigration.env=development.localhost
3. Step by step instruction how to install and how to do update
rem installation
mvn migration:bootstrap -Dmigration.env=development_localhost_root
rem get status
mvn migration:status -Dmigration.env=development_localhost
rem do update
mvn migration:up -Dmigration.env=development_localhost

How to ALTER TABLE tttt ADD CONSTRAINT ccc
1) both tables are InnoDB.
2) both tables have data in them.
3) both table are the exact same data types.

################################################
Here is a list of commonly used commands

1. To see current status of database

mvn migration:status

Example:
[INFO] Executing  Apache Migration StatusCommand
[INFO] ID             Applied At             Description
[INFO] ================================================================================
[INFO] 20100400000001    2010-04-24 22:51:16    create changelog
[INFO] 20100400000002    2010-04-24 22:51:17    first migration
[INFO] 20100400000003    ...pending...          my second schema migration
[INFO]

The pending migration is not yet applied to database.

2. To update database up to the latest available script

mvn migration:up 

All pending scripts will be run

3. To revert the latest applied change

mvn migration:down

Please take notice that as a result of this action the "UNDO" section of the latest not-pending script will be run.
Developer is responsible for creating valid "UNDO" sections along with "DO" ones

4. To create new script

mvn migration:new -Dmigration.description="SOME DESCRIPTION HERE"

5. To run command for some non-default environment

add the -Dmigration.env=%ENV_NAME% parameter while running command


For more information please visit 
http://www.99soft.org/projects/maven-migration-plugin/1.1/
